package com.ayoka.parenting.ui.live.liveclassroom;

import android.app.Activity;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.widget.PopupWindow;

import com.ayoka.parenting.bean.BaseResponse;
import com.ayoka.parenting.bean.BasicUserInfoBean;
import com.ayoka.parenting.bean.ChatMessageBean;
import com.ayoka.parenting.bean.DiscussGroupBean;
import com.ayoka.parenting.bean.DiscussGroupTempRoomBean;
import com.ayoka.parenting.bean.GrownClassroomDetailBean;
import com.ayoka.parenting.interf.RequestCallback;
import com.ayoka.parenting.mvp.BasePresenter;
import com.ayoka.parenting.mvp.BaseView;
import com.tencent.imsdk.TIMMessage;

import java.util.List;

/**
 * @ProjectName: MVPPlugin.
 * @ClassName: LiveClassroomContract.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/10/10 18:17.
 */
public class LiveClassroomContract {

    public interface View extends BaseView {
        void configLiveRoomDetailData(GrownClassroomDetailBean data);

        void addBoardView();

        void onTEBHistoryDataSyncCompleted();

        void onJoinLiveRoomCallback(boolean isSuccess);

        void configScheduleTempSubRoom(DiscussGroupTempRoomBean data);

        void configOnlineMemberList(List<BasicUserInfoBean> memberList);

        void onQuitLiveRoomCallback(boolean isSuccess, boolean needFinishActivity);

        void createDiscussGroupRoomCallback(boolean isSuccess, int roomId, String scheduleId);

        void onDialogDismiss(DialogFragment dialog);

        void onPopupDismiss(PopupWindow popupWindow);
    }

    interface Presenter extends BasePresenter<View> {
        void enterLiveRoom(String scheduleId);

        List<String> getCourseStepList();

        void joinLiveRoom(int roomId, int role);

        void loadMoreMessage(TIMMessage message);

        void getScheduleTempSubRoom(String scheduleId);

        void saveChatMessage(String userId, boolean isChatToSelf, String content, String receive, TIMMessage message);

        void quitLiveRoom(boolean isSuccess, DiscussGroupBean subRoom);

        void showExitDialog(Activity activity);

        void showWhiteBoardDialog(FragmentManager fragmentManager);
        
        void showChatMessageDialog(FragmentManager fragmentManager);

        void showCourseStepPopup(Activity activity, android.view.View view, String courseTitle, int currentStep);

        void sendGroupTextMessage(String message);

        void sendTextMessage(String userId, final String message);

        List<BasicUserInfoBean> getMemberList();

        List<BasicUserInfoBean> formatUserBeanList(List<BasicUserInfoBean> members);

        void saveMember(BasicUserInfoBean coach);
    }

    interface Model {
        void enterLiveRoom(BasePresenter presenter, String scheduleId, RequestCallback<GrownClassroomDetailBean> requestCallback);

        List<String> getCourseStepList();

        void getScheduleTempSubRoom(BasePresenter presenter, String scheduleId, RequestCallback<BaseResponse<DiscussGroupTempRoomBean>> requestCallback);

        BasicUserInfoBean getMemberByUserId(String userId, boolean isNeedAdd);

        void saveChatMessage(ChatMessageBean chatMessageBean);

        void saveChatMessage(int index, ChatMessageBean chatMessageBean);

        BasicUserInfoBean removeMemberByUserId(String userId);
    }
}
